package com.example.demo.service.impl;

import com.example.demo.entity.Car;
import com.example.demo.entity.DTO.GoodsDTO;
import com.example.demo.entity.DTO.SelectCarDTO;
import com.example.demo.mapper.CarMapper;
import com.example.demo.service.ICarService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 购物车 服务实现类
 * </p>
 *
 * @author Mr.sdy
 * @since 2024-06-06
 */
@Service
public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarService {
    @Autowired
    private CarMapper carMapper;
    @Override
    public boolean addCar(Car car) {
        return carMapper.insertCar(car) > 0;
    }

    @Override
    public List<SelectCarDTO> selectCar(Integer car) {
        return carMapper.selectCar(car);
    }

}
